package cn.shadow.game.chess.CHnchess.mesage;

import cn.shadow.moulde.Modules;
import cn.shadow.utils.BufferUtil;
import io.netty.buffer.ByteBuf;
import static cn.shadow.utils.BufferUtil.newDynamicMessage;
import static cn.shadow.utils.BufferUtil.onlySendHeaderMessage;
/**
* 象棋
* Created by CodeMaker
* Created time: 2020-08-19 10:15:11
*/
public class CHChessModuleMessages {
    public static final int MODULE_ID = Modules.CHCHESS_MODULE_ID;


    /**
    *返回选中棋子数据
    */
    public static final int S2C_CHCHESS_CHOSEN=1002;
    public static ByteBuf ChosenMsg(byte[] chosenData) {
        ByteBuf buffer = newDynamicMessage(MODULE_ID, S2C_CHCHESS_CHOSEN);

        BufferUtil.writeBytes(buffer,chosenData); //棋局数据

        return buffer;
    }

    /**
    *提示将军
    */
    public static final int S2C_CHCHESS_CHECKMATE_TIP=4004;
    public static ByteBuf CheckmateTipMsg(byte[] checkmateData) {
        ByteBuf buffer = newDynamicMessage(MODULE_ID, S2C_CHCHESS_CHECKMATE_TIP);

        BufferUtil.writeBytes(buffer,checkmateData); //将军数据

        return buffer;
    }

    /**
    *返回棋子移动数据
    */
    public static final int S2C_CHCHESS_MOVE=4006;
    public static ByteBuf MoveMsg(byte[] moveData) {
        ByteBuf buffer = newDynamicMessage(MODULE_ID, S2C_CHCHESS_MOVE);

        BufferUtil.writeBytes(buffer,moveData); //移动数据

        return buffer;
    }

    /**
    *初始化棋局
    */
    public static final int S2C_CHCHESS_INIT_CHESS=4008;
    public static ByteBuf InitChessMsg(byte[] initChessData) {
        ByteBuf buffer = newDynamicMessage(MODULE_ID, S2C_CHCHESS_INIT_CHESS);

        BufferUtil.writeBytes(buffer,initChessData); //初始化棋局数据

        return buffer;
    }

}
